﻿using System;
using System.Xml;
using System.Collections.ObjectModel;
using System.ComponentModel;
using Elentok.Common;
using Elentok.Common.Collections;

namespace AMail.Common.Interfaces.Data
{
  public interface IMailFolder : INotifyPropertyChanged, IActionableObject
  {
    VeryObservableCollection<IMailMessage> Messages { get; }
    VeryObservableCollection<IMailFolder> Subfolders { get; }

    string Name { get; set; }
    IMailFolder ParentFolder { get; set; }
    IMailFolder PreviousParentFolder { get; }
    IMailArchive OwnerArchive { get; }

    void WriteXml(XmlTextWriter writer);

    /// <summary>
    /// Creates a new subfolder (and adds it to this parent);
    /// </summary>
    /// <param name="name">The name of the folder</param>
    /// <returns></returns>
    IMailFolder CreateSubfolder(string name);
  }
}
